Skip to content

Conversation

@gkrajniak
Copy link
Collaborator

@gkrajniak gkrajniak commented Sep 17, 2025

Summary by CodeRabbit

  • Refactor
    • Organization and entity IDs in the global context now consistently use the organization’s originClusterId, improving consistency across views. Adds fail-fast handling when this value is missing.
  • Tests
    • Updated tests to reflect originClusterId-based ID generation.
  • Chores
    • Added kubernetes-types as a development dependency.
  • New Features
    • Consolidated portal options models into a single import entry point for cleaner integrations (no functional changes for end users).

@coderabbitai
Copy link

coderabbitai bot commented Sep 17, 2025

Walkthrough

Switches cluster ID source from annotation to spec.organization.originClusterId in the Luigi global context service, adds a guard when missing, and updates tests. Introduces a new services/models module with Kubernetes-oriented types, updates resource.service imports and GraphQL to fetch originClusterId, exposes models via public API, and adds a devDependency.

Changes

Cohort / File(s) Summary
Dependencies
package.json
Added devDependency kubernetes-types@^1.30.0.
Global context config logic and tests
projects/lib/portal-options/services/luigi-extended-global-context-config.service.ts, projects/lib/portal-options/services/luigi-extended-global-context-config.service.spec.ts
Replace cluster ID source from metadata.annotations['kcp.io/cluster'] to spec.organization.originClusterId. Add fail-fast guard (error log) when missing. Update expected IDs in tests to use originClusterId.
Resource service imports and query
projects/lib/services/resource/resource.service.ts
Refactor imports to use local models for AccountInfo, Resource, ResourceDefinition; adjust utility import formatting; remove internal ResourceResponse type; GraphQL readAccountInfo now selects organization { originClusterId }.
Models and public exports
projects/lib/services/models/resource.ts, projects/lib/services/models/index.ts, projects/lib/services/public-api.ts
Add Kubernetes-oriented model interfaces/types (e.g., AccountInfo, Resource, ResourceDefinition, UIDefinition, etc.) using kubernetes-types. Create barrel models/index.ts. Re-export models from services/public-api.ts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between e2ba359 and 340e12d.

📒 Files selected for processing (4)
  • projects/lib/services/models/index.ts (1 hunks)
  • projects/lib/services/models/resource.ts (1 hunks)
  • projects/lib/services/public-api.ts (1 hunks)
  • projects/lib/services/resource/resource.service.ts (2 hunks)

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@gkrajniak gkrajniak changed the title Fix reading ogranization cluster id bug: fix reading ogranization cluster id Sep 17, 2025
@gkrajniak gkrajniak self-assigned this Sep 17, 2025
@nexus49 nexus49 merged commit 1d794ed into main Sep 17, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix LuigiExtendedGlobalContextConfigServiceImpl to recive properly the organizationId

4 participants